<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8" />
	<title></title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" type="text/css" href="../../css/index_1.css" />
	<script src="../../js/jquery3.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" type="text/css" href="../../layui/css/layui.css" media="all" />
	<link rel="stylesheet" type="text/css" href="../../css/index_icon.css" />
</head>

<body>
	<div class="bg">
		<div class="layui-container">
			<!-- 	<div class="title layui-bg-black">
				</div> -->
			<div class="layui-row layui-col-space6 row1">
				<div class="layui-col-md4">
					<div class="grid-demo grid-demo-bg1 grid1">
						<i class="iconfont icon-user-circle"></i>
						<div class="data">
							<h3>新增客户</h3>
							<h1><span id="newCu"></span></h1>
						</div>
						<span style="font-size: 40px;color: #cacaca; margin-top: 15px;">&#124;</span>
						<div class="than">
							<h4>较上月</h4>
							<h5><em>45</em> &#37;</h5>
						</div>
					</div>
				</div>
				<div class="layui-col-md4 grid-demo-bg1 ">
					<div class="grid-demo grid1">
						<i class="iconfont icon-databaseplus-fill"></i>
						<div class="data">
							<h3>新增订单</h3>
							<h1><span id="newOr"></span></h1>
						</div>
						<span style="font-size: 40px;color: #cacaca; margin-top: 15px;">&#124;</span>
						<div class="than">
							<h4>较上月</h4>
							<h5><em>35</em> &#37;</h5>
						</div>
					</div>
				</div>
				<div class=" layui-col-md4">
					<div class="grid-demo grid-demo-bg1 grid1">
						<i class="iconfont icon-phone"></i>
						<div class="data">
							<h3>新增联系人</h3>
							<h1><span id="newCo"></span></h1>
						</div>
						<span style="font-size: 40px;color: #cacaca; margin-top: 15px;">&#124;</span>
						<div class="than">
							<h4>较上月</h4>
							<h5><em>33</em> &#37;</h5>
						</div>
					</div>
				</div>
			</div>
			<div class=" layui-row layui-col-space6 row1">
				<div class="layui-col-md4">
					<div class="grid-demo grid-demo-bg1 grid1">
						<i class="iconfont icon-chart-bar"></i>
						<div class="data">
							<h3>销售量</h3>
							<h1><span id="saleNum"></span></h1>
						</div>
						<span style="font-size: 40px;color: #cacaca; margin-top: 15px;">&#124;</span>
						<div class="than">
							<h4>较上月</h4>
							<h5><em>46</em> &#37;</h5>
						</div>
					</div>
				</div>
				<div class="layui-col-md4 grid-demo-bg1 ">
					<div class="grid-demo grid1">
						<i class="iconfont icon-transanction"></i>
						<div class="data">
							<h3>销售额</h3>
							<h1><span id="sale"></span></h1>
						</div>
						<span style="font-size: 40px;color: #cacaca; margin-top: 15px;">&#124;</span>
						<div class="than">
							<h4>较上月</h4>
							<h5><em>76</em> &#37;</h5>
						</div>
					</div>
				</div>
				<div class="layui-col-md4">
					<div class="grid-demo grid-demo-bg1 grid1">
						<i class="iconfont icon-calendaralt-fill"></i>
						<div class="data">
							<h3>新增目标</h3>
							<h1><span id="newTr"></span></h1>
						</div>
						<span style="font-size: 40px;color: #cacaca; margin-top: 15px;">&#124;</span>
						<div class="than">
							<h4>较上月</h4>
							<h5><em>23</em> &#37;</h5>
						</div>
					</div>
				</div>
			</div>
		</div>

		<div class="tubiao">
			<div class="tb_nav" style="width: 800px;height: 40px; margin: 0 auto;padding-top: 20px;">
				<div class="layui-row">
					<div class="layui-col-xs3 active" ref="nav1">
						<div class="grid-demo2 grid-demo-bg1 layui-bg-black">
							<h3><b>客户来源</b></h3>
						</div>
					</div>
					<div class="layui-col-xs3" ref="nav2">
						<div class="grid-demo2 layui-bg-blue">
							<h3><b>订单</b></h3>
						</div>
					</div>
					<div class="layui-col-xs3" ref="nav3">
						<div class="grid-demo2 grid-demo-bg1 layui-bg-black">
							<h3><b>产品销售</b></h3>
						</div>
					</div>
					<div class="layui-col-xs3" ref="nav4">
						<div class="grid-demo2 layui-bg-blue">
							<h3><b>目标</b></h3>
						</div>
					</div>
				</div>
			</div>
			<div>
				<div id="tree_photo1" class="nav1"></div>
				<div id="tree_photo2" class="nav2"></div>
				<div id="tree_photo3" class="nav3"></div>
				<div id="tree_photo4" class="nav4"></div>
			</div>
		</div>
	</div>
	<script src="../../layui/layui.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../js/echarts.min.js" type="text/javascript" charset="utfclikc-8"></script>
	<script src="../../js/chart.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		$(function () {
			$(".nav1").siblings().hide();
			$(".tb_nav .layui-col-xs3").click(function () {
				var refAttr = $(this).attr('ref');
				$('.' + refAttr).show();
				$('.' + refAttr).siblings().hide();
				$(".tb_nav .layui-col-xs3").removeClass("active");
				$(this).addClass("active")
			})
			$.post("/user/getSelf", {}, function (data) {
				if (data != null) {
					//新增客户
					$.post("/indexController/findNewC", {}, function (data) {
						$("#newCu").text(data);
					});
					//新增订单
					$.post("/indexController/findNewOr", {}, function (data) {
						$("#newOr").text(data);
					});
					//新增联系人
					$.post("/indexController/findNewCo", {}, function (data) {
						$("#newCo").text(data);
					});
					//销售量
					$.post("/indexController/findSaleNum", {}, function (data) {
						$("#saleNum").text(data);
					});
					//销售额
					$.post("/indexController/findSale", {}, function (data) {
						$("#sale").text(data);
					});
					//新增目标
					$.post("/indexController/findNewTr", {}, function (data) {
						$("#newTr").text(data);
					});
				} else {
					alert("未登录，请先登录")
					location.href = "../login/login.html"
				}
			})
		})

	</script>
</body>

</html>